import { GetHttpTraits } from "./http";
import { GetSelectionTask } from "../task/selection";

export class GetSelectionTraits extends GetHttpTraits {
    constructor(instance, trait_name = "private_seletions") {
        super(instance, new GetSelectionTask());
        var self = this;
        return {
            _data() {
                var ret = {};
                ret[trait_name] = self.private_data();
                self.private_methods(ret[trait_name]);
                return ret;
            },
        }
    }

    private_handle(option, key) {
        option.label = option.name;
        option.value = option.id;
        option.selected = false;
        return option;
    }
}